﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FluorineFx.Net;
using System.Collections;
using FluorineFx.AMF3;
using FluorineFx.Messaging.Api.Service;

namespace GameInfo
{
    public class BaseInfo
    {
        private string m_SessionCookie;
        public string SessionCookie
        {
            get { return m_SessionCookie; }
            set
            {
                m_SessionCookie = value;
            }
        }
        

        public void GetBaseInfo(string address)
        {
            NetConnection client = new NetConnection();
            client.ObjectEncoding = FluorineFx.ObjectEncoding.AMF3;
            client.Connect(@"http://skype.space.ccnec.com/GameServices/flashservices/gateway.php");
            ArrayList msg = new ArrayList();
            string[] point = address.Split('.');
            msg.Add(point[0]);
            msg.Add(point[1]);
            msg.Add(point[2]);
            msg.Add("1244092368");
            msg.Add("1244092368");
            msg.Add("1244092368");
            msg.Add("1244092368");
            msg.Add("1244092368");
            //client.AddHeader("AppendToGatewayUrl", false, m_SessionCookie);
            //client.Connect()
            
            client.Call("spacewar.loginService.getRefresh", new GetCustomersHandler(), msg);
            
            
        }
    }

    public class GetCustomersHandler : IPendingServiceCallback
    {
        public void ResultReceived(IPendingServiceCall call)
        {
            object result = call.Result;
            //DataAccess sample sends back an ArrayCollection (AMF3)
            ArrayCollection items = result as ArrayCollection;

        }
    }
}
